{% extends 'base.html' %}

{% block title %}
模块列表: {{ data.pdm_info.file_name }}
{% endblock %}

{% block content %}
<h1>📂 {{ data.pdm_info.file_name }}</h1>

<!-- 文件信息表 -->
<div class="card mt-3">
    <div class="card-header">文件信息</div>
    <div class="card-body">
        <table class="table table-bordered">
            <tbody>
            <tr>
                <th>文件名</th>
                <td>{{ data.pdm_info.file_name }}</td>
            </tr>
            <tr>
                <th>数据库类型</th>
                <td>{{ data.pdm_info.database_type }}</td>
            </tr>
            <tr>
                <th>文件修改时间</th>
                <td>{{ data.pdm_info.file_modify_time }}</td>
            </tr>

            <tr>
                <th>大小</th>
                <td>{{ data.pdm_info.file_size }}</td>
            </tr>
            <tr>
                <th>表数量</th>
                <td>{{ data.pdm_info.table_count }}</td>
            </tr>

            </tbody>
        </table>
    </div>
</div>

<!-- 模块信息表 -->
<div class="card mt-3">
    <div class="card-header">模块信息</div>
    <div class="card-body">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>fid</th>
                <th>模块</th>
                <th>分组</th>
                <th>描述</th>
                <th>表数量</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for m in data.modules %}
            <tr>
                <td>{{ m.fid }}</td>
                <td>{{ m.m_name }}</td>
                <td>{{ m.phy_name }}</td>
                <td>{{ m.phy_code }}</td>
                <td>{{ m.table_count }}</td>
                <td>
                    <a class="btn btn-success btn-sm"
                       href="/tables/{{m.fid}}/{{m.pdm_id}}/">查看列表</a>
                </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}